package com.slliver.sentinelservice.openfeign.fallback;

import com.slliver.commonmodel.product.Product;
import com.slliver.sentinelservice.openfeign.ProductFeignClient;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;


@Component
public class ProductFeignClientFallback implements ProductFeignClient {

    @Override
    public Product getProductById(Long productId, String token) {
        System.out.println("商品服务的兜底回调");
        Product product = new Product();
        product.setId(productId);
        product.setProductName("未知商品");
        product.setPrice(new BigDecimal("0"));
        product.setNum(0);
        product.setDesc("发生错误了，为了有好提示显示兜底商品");
        return product;
    }
}
